#include "deck.h"
#include <vector>
#include <cstdlib>

using std::vector;


deck::deck(){

	for (int j=0;j<=12;++j){
		for (int i=0;i<=3;++i){
			cardSet.push_back(card(static_cast<suit>(i),static_cast<rank>(j)));
		}
	}
}


card deck::getRandomCard(){

	int cardSetSize=(int) cardSet.size();
	int i=rand()%cardSetSize;
	card randomCard=cardSet[i];
	cardSet.erase(cardSet.begin()+i);
	return randomCard;
}


void deck::print(){

	vector<card>::const_iterator it;
	for (it=cardSet.begin();it!=cardSet.end();++it){

		std::cout<<(*it)<<std::endl;
	}
}